<?php
	
function chonNhaSanXuat(){
   	$sqlstr = mysql_query("SELECT * FROM tbl_category where cat_product='1'");
 	if(@mysql_num_rows($sqlstr)>0){
	   	while($row=mysql_fetch_array($sqlstr)){		
			echo "<option value='".$row['cat_id']."'>".$row['cat_name']."</option>";		
		}
	}
}
/*
function chonKhoangGia(){
	$sqlstr = mysql_query("Select * From tbl_product");
	if(@mysql_num_rows($sqlstr)>0){
		while($row=mysql_fetch_array($sqlstr)){
			echo "<option value='".$row['pd_id']."'>".$row['pd_price']."</option>";
		}
	}
}

function chonHeDieuHanh(){
	$sqlstring=mysql_query("Select * From hedieuhanh Where MaHeDieuHanh <> '1'");
	if(@mysql_num_rows($sqlstring)>0){
		while($row=mysql_fetch_array($sqlstring)){
			echo "<option value='".$row['MaHeDieuHanh']."'>".$row['TenHeDieuHanh']."</option>";
		}	
	}
}

function chonChucNang(){
	$sqlstr= mysql_query("Select * From chucnang");
	$i=0;
	$dem=@mysql_num_rows($sqlstr);
	if($dem>0){
		while($row= mysql_fetch_array($sqlstr) ){
			
			if($i<$dem/2){
				echo "<div id='checkbox1'>";?>
				<input type='checkbox' name='cb[]' value='<?php echo $row['TenTruong'];?>' id='<?php echo $row['TenChucNang']; ?>' /><?php echo $row['TenChucNang'];?> <br/>
<?php			echo "</div>";
			}
			
			
			if($i>=$dem/2){
				echo "<div id='checkbox2'>";?>
				<input type='checkbox' name='cb[]' value='<?php echo $row['TenTruong'];?>' id='<?php echo $row['TenChucNang']; ?>'/><?php echo $row['TenChucNang'];?> <br/>
<?php			echo "</div>";
			}
			$i++;
		}
		
	}
}

function menuNhaSanXuat(){
	$sqlstr = mysql_query("SELECT * FROM nhasanxuat");
	   if(mysql_num_rows($sqlstr)>0){
	   		while($row=mysql_fetch_array($sqlstr)){	?>			
				<li><a href='/banhang/dienthoai/xemloai/dienthoai.php?start=0&loainsx=<?php echo $row['MaNhaSanXuat'];?>'><?php echo $row['TenNhaSanXuat'];?></a></li>
                
<?php		}
	 }
}

function menuSanPhamKhac(){
	$sqlstr = mysql_query("SELECT * FROM loaisanpham Where MaLoaiSanPham<>'1'");
	   if(mysql_num_rows($sqlstr)>0){
	   	while($row=mysql_fetch_array($sqlstr)){		
			echo "<li><a>".$row['TenLoaiSanPham']."</a></li>";		
		}
	 }
}
*/
?>
	
